//
//  ProgressHUD.m
//  YJMusicPlayer
//
//  Created by lanou3g on 15/6/29.
//  Copyright (c) 2015年 杨建. All rights reserved.
//

#import "ProgressHUD.h"

@implementation ProgressHUD

+ (void)progressHUD:(UIView *)view labelText:(NSString *)text;
{
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:view];
    [view addSubview:HUD];
    
    HUD.dimBackground = YES;
    // 设置对话框文字
    HUD.labelText = text;
    HUD.labelColor = [UIColor whiteColor];
    HUD.backgroundColor = [UIColor RGBColor:255 green:255 blue:255 alpha:0.1];
    HUD.mode = MBProgressHUDModeText;
    //显示对话框
    [HUD showAnimated:YES whileExecutingBlock:^{
        //对话框显示时需要执行的操作
        sleep(1.0);
    } completionBlock:^{
        //操作执行完后取消对话框
        [HUD removeFromSuperview];
    }];
}


+ (void)progressHUDAnimation:(UIView *)view labelText:(NSString *)text;
{
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:view];
    [view addSubview:HUD];
    
    HUD.dimBackground = YES;
    // 设置对话框文字
    HUD.labelText = text;
    HUD.mode = MBProgressHUDAnimationFade;
    //显示对话框
    [HUD showAnimated:YES whileExecutingBlock:^{
        //对话框显示时需要执行的操作
        sleep(1.0);
    } completionBlock:^{
        //操作执行完后取消对话框
        [HUD removeFromSuperview];
    }];
}


@end
